package demo3;

//牛客网:对称之美
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t-- > 0) {
            int n = in.nextInt();
            String[] strs = new String[n];
            for(int i = 0; i<n; i++) {
                strs[i] = in.next();
            }
            int[][] hash = new int[n][26];
            for(int i = 0; i<n; i++) {
                for(int j = 0; j<strs[i].length(); j++) {
                    hash[i][strs[i].charAt(j)-'a']++;
                }
            }

            int l = 0, r = n-1;
            int flag = 0;
            while(l<r) {
                int i = 0;
                for(i = 0; i<strs[l].length(); i++) {
                    if(hash[r][strs[l].charAt(i)-'a']!=0) {
                        break;
                    }
                }
                if(i == strs[l].length()) {
                    flag = 1;
                    break;
                }
                l++;
                r--;
            }
            if(flag == 0) {
                System.out.println("Yes");
            }else {
                System.out.println("No");
            }

        }
    }
}